<%@page contentType="text/html;charset=UTF-8" language = "java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
	<title>
	<c:choose>
		<c:when test="${param.action eq 'word'}">
			所有词表如下
		</c:when>
		<c:when test="${param.action eq 'file'}">
			所有文件如下
		</c:when>
		<c:when test="${param.action eq 'catelog'}">
			所有目录如下
		</c:when>
		<c:otherwise>
			所有目录如下
		</c:otherwise>
		</c:choose> | JWiki
	</title>
	<link rel="stylesheet" href="texts/style.css" type="text/css" />
</head>
<body>
	<div id="page-wrapper">
		<c:import url="header.jsp"/>
		<c:import url="sidebar.jsp"/>		
		<div id="content">
			<c:import url="s_navs.jsp"/>	
			<h2>您需要查看的是：</h2>
			<ul class="search-results">
			<c:forEach items="${itemslist}" var="item">
				<li><span><a href="page.do?action=read&id=<c:out value="${item.itemId}"/>"><c:out value="${item.title}"/></a></span>: 
				<span class="excerpt"><c:choose>
					<c:when test="${fn:length(item.content) > 10}">
						<c:out value="${fn:substring(item.content, 0, 10)}..." />
					</c:when>
					<c:otherwise>
						<c:out value="${item.content}" />
					</c:otherwise>
					</c:choose>
				</span></li>
			</c:forEach>
			</ul>
			<p class="page-nav">
			<c:if test="${previous > 0}">
			<a class="pre-nav" href="list.do?action=<c:out value="${param.action}" />&page=<c:out value="${previous}" />">上一页</a>
			</c:if>
			<c:if test="${next > 0}">
			<a class="next-nav" href="list.do?action=<c:out value="${param.action}" />&page=<c:out value="${next}" />">下一页</a>
			</c:if>
			</p>
		</div>
		<c:import url="footer.jsp"/>
	</div>	
</body>
</html>